/**
 *
 */
package com.idea.zd.sys.te;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.idea.zd.sys.util.CreateFile;
import com.jfinal.kit.HttpKit;
import com.jfinal.kit.JsonKit;
import org.apache.poi.ss.formula.functions.T;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

/**
 * @author y.z
 */
public class Test {

	/*public static void main(String[] args) throws Exception{
		System.out.println("123");
        WebClient client = new WebClient(BrowserVersion.CHROME);
        client.getOptions().setJavaScriptEnabled(true);    //默认执行js，如果不执行js，则可能会登录失败，因为用户名密码框需要js来绘制。
        client.getOptions().setCssEnabled(false);
        client.setAjaxController(new NicelyResynchronizingAjaxController());
        client.getOptions().setThrowExceptionOnScriptError(false);

        HtmlPage page = client.getPage("http://login.sina.com.cn/sso/login.php?client=ssologin.js(v1.3.16)");
        //System.out.println(page.asText());
        //登录
        HtmlInput ln = page.getHtmlElementById("username");
        HtmlInput pwd = page.getHtmlElementById("password");
        //HtmlInput btn = page.getFirstByXPath(".//*[@id='vForm']/div[3]/ul/li[6]/div[2]/input");
        System.out.println(page.getFirstByXPath(".//*[@id='vForm']/div[2]/div/ul/li[7]/div/input"));
        HtmlInput btn = page.getFirstByXPath(".//*[@id='vForm']/div[2]/div/ul/li[7]/div/input");

        ln.setAttribute("value", "466636298@qq.com");
        pwd.setAttribute("value", "tiancaize6712");

        HtmlPage page2 = btn.click();
        //登录完成，现在可以爬取任意你想要的页面了。
        System.out.println("\n\n\n");
        //System.out.println(page2.asText());

        HtmlPage page3 = client.getPage("http://weibo.com/u/5649451888?is_all=1");
        String sss = page3.asText();
        //System.out.println("page3 : " + page3.asXml());

        client.closeAllWindows();
        System.out.println("page3"+sss);
    }*/

	public static void main(String[] args) throws Exception{


		Map<String,String> ss = new HashMap<>();


		if(null != ss.get("sss")){
			System.out.println("bbbb");
		}



	    int i = 0;

	    if(i > ++i & i > ++i){
	        System.out.println(true);
        }
        System.out.println(i);

        /*String url = "http://st.seeeton.com/anchorService/api/anchor/login";

        Map headers = new HashMap();
        headers.put("Content-Type", "application/json");
        headers.put("access_token", "123456");
        Map<String, String> apiParams = new HashMap<>();
        apiParams.put("account","123456");
        apiParams.put("password","123456");

        String json = JsonKit.toJson(apiParams);

        try{
            String ret = HttpKit.post(url,json, headers);

            System.out.print(ret);

        }catch (Exception e){
            e.printStackTrace();
        }*/
        /*Random random = new Random();
        int i = random.nextInt(10)+1;
        System.out.print("随机数"+i);*/


		/*int x,y;

		for(x =1,y=1;y<=50;y++){
			if(x>=10){
				break;
			}
			if(x%2==1){
				x+=5;
				continue;
			}
			x-=3;
		}
		System.out.println("x:"+x+",y:"+y);*/
		 /*WebClient webClient= new WebClient(BrowserVersion.CHROME);//设置浏览器
		 webClient.getOptions().setThrowExceptionOnScriptError(false);
		 webClient.getOptions().setJavaScriptEnabled(true);
         webClient.getOptions().setCssEnabled(false);
         webClient.getOptions().setRedirectEnabled(true);
         webClient.getOptions().setThrowExceptionOnScriptError(false);
         webClient.getOptions().setUseInsecureSSL(true);
         webClient.getOptions().setDoNotTrackEnabled(false);
         webClient.getOptions().setTimeout(50000);
	     HtmlPage htmlPage=webClient.getPage("http://www.iqiyi.com/v_19rr8s9o0k.html");//访问路径设置
	     String ss = htmlPage.asXml();
	     CreateFile.createFile(ss, "as.txt", "D:/");
	     webClient.close();
	     //System.out.println(ss);
	     System.out.println("1111111111111");*/

		 /*String ss = "05505215481156238,1556476426059740,0207540146847885,1556476426059740,0207540146847885,092322665126258748,054110233026234250";
		 String bb = "092322665126258748";
		 int index = ss.indexOf(bb)+bb.length();
		 index = index < ss.length()?++index:index;
		 String cc = ss.substring(index,ss.length()) +"";

		 String [] qq  = cc.split(",");
		 System.out.println(qq.length);
		 for(String q:qq){
			 System.out.println(q);
		 }*/

		/*String json = "[{\"a\":\"111\",\"b\":\"222\",\"c\":\"333\"},{\"a\":\"1000\",\"b\":\"2000\",\"c\":\"000\"},{\"a\":\"999\",\"b\":\"300\",\"c\":\"700\"}]";
		JSONArray jsonArr = JSONArray.parseArray(json);
		Map map = JSON.parseObject(jsonArr.get(0).toString(),Map.class);

		System.out.print(map);*/

		//经转度
		System.out.println(29.73784595);
		System.out.println(0.73784595*60);
		System.out.println(0.270756999999996*60);

		//度转经
		System.out.println("29°44′16.25");
		System.out.println(29+(44.0/60)+(16.25/3600));
		System.out.println("1180248");
		System.out.println(118+(2.0/60)+(48.0/3600));

		System.out.println(new Double(30).equals("30.0"));

    }
}
